// pages/feedback/index.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    tabs: [
      {
        id: 0,
        value: "体验问题",
        isActive: true,
      },
      {
        id: 1,
        value: "商品/商家投诉",
        isActive: false,
      },
    ],
  },

  //标题点击事件，从子组件传递过来
  handleTabsItemChange(e) {
    //1, 获取被点击的标题索引
    const { index } = e.detail;
    //2， 修改源数组
    let { tabs } = this.data;
    tabs.forEach((v, i) => i === index ? v.isActive = true : v.isActive = false)
    //3,赋值到data
    this.setData({
      tabs
    })

  },
})